/**
 * Created by Administrator on 2018/6/19.
 */
$(function(){
    /*选中表单初始化函数*/
    $('#login').bootstrapValidator({
        /*input状态样式图片*/
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        /*验证：规则*/
        fields: {
            /*找到验证的输入框的name*/
            /*用户名验证*/
            username: {
                ///*默认样式，用户不设定是作用*/
                // message: 'This value is not valid',
                validators: {//验证器
                    notEmpty: {//非空验证：提示信息
                        message: '请输入学号'
                    },
                    /*用户名不存在*/
                    callback: {
                        message: '学号不存在'
                    },
                    stringLength: {
                        min: 11,
                        max: 11,
                        message: '请输入11位学号'
                    }
                }
            },
            /*密码验证*/
            password: {
                validators: {
                    notEmpty: {
                        /*非空验证*/
                        message: '请输入密码'
                    },
                    stringLength: {
                        min: 6,
                        max: 18,
                        message: '密码必须在6到18之间'
                    },
                    /*密码错误*/
                    callback: {
                        message: '密码错误'
                    }

                }
            },
            /*验证码验证*/
            yanzheng: {
                validators: {
                    notEmpty: {
                        /*非空验证*/
                        message: '验证码不能为空'
                    },
                    stringLength: {
                        min: 4,
                        max: 4,
                        message: '请输入4位验证码'
                    }
                }
            }
        }
    })
});